package com.control.qct.businesssteward.service;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;

import com.control.qct.businesssteward.activity.LoginActivity;
import com.control.qct.businesssteward.utils.ActivityCollector;
import com.control.qct.businesssteward.utils.DialogUtil;

/**
 * 强制下线广播
 * Created by Administrator on 2018/3/8 0008.
 */

public class ForceOfflineReceiver extends BroadcastReceiver {
    @Override
    public void onReceive(final Context context, Intent intent) {
        DialogUtil.getAlertDialog(context, "警告","你已退出登录，请重新登录！", "重新登录", new DialogInterface.OnClickListener() {
            @Override
            public void onClick(DialogInterface dialogInterface, int i) {
                ActivityCollector.finishAll();
                Intent reIntent = new Intent(context, LoginActivity.class);
                context.startActivity(reIntent);
            }
        }).show();
    }
}
